Crate tezos_smart_rollup_core
source ·Expand description
Core API for the virtual smart_rollup_core
WASM module, exposed by
Tezos Smart Rollups.
About
In order for a kernel to do useful work, it must be able to read input from users, respond with output, and update its internal state. To do so, rollups make a set of C-style host functions available to kernels, which enable:
- reading from the inbox.
- writing to the outbox.
- manipulating durable storage.
This crate provides the definitions of these host functions, including linking to the smart_rollup_core
WASM module.
In addition, various constants (such as error codes) used when interacting with these host functions, are defined here.
Safety
This crate exposes the host functions through the SmartRollupCore
trait, which is unsafe to use - as it makes no effort
to provide a safe rust API. A safe API is defined in the tezos-smart-rollup-host
crate, as the Runtime
trait.
It’s therefore recommended to use the Runtime
trait directly from the tezos-smart-rollup-host
crate, or
alternatively directly through the tezos-smart-rollup
top-level SDK crate.
Re-exports
pub use smart_rollup_core::SmartRollupCore;
Modules
- Implementation of
SmartRollupCore
used when compiling to wasm. - Definition of the
smart_rollup_core
host functions.
Constants
- The outbox is full an cannot accept new messages at this level.
- Generic error code for unexpected errors.
- The input or output submitted as an argument of a host function exceeds the authorized limit.
- The maximum size that may be written to, or read from, disk in one go.
- The maximum size of input that can be read in one go from a Layer 1 message.
- The maximum size of input that can be read in one go from a slot message.
- The maximum size that may be written to
output
in one go. - An address is out of bound of the memory.
- The size of a preimage Reveal_hash hash in bytes.
- An access in a value of the durable storage has failed, supposedly out of bounds of a value.
- The store key submitted as an argument of a host function cannot be parsed.
- The store key submitted as an argument of a host function exceeds the authorized limit.
- There is no tree at key. It has no value, nor any subtrees.
- The contents (if any) of the store under the key submitted as an argument of a host function is not a value.
- A value cannot be modified if it is readonly.
- Writing a value has exceeded 2^31 bytes.
- None ValueType discriminant.
- Subtree ValueType discriminant, for a subtree node in the store.
- Value ValueType discriminant, for a simple value in the store.
- Value with subtree ValueType discriminant, for a value carrying a subtree node in the store.